'use strict'

module.exports = function (sequelize, DataTypes) {
  const MercadoLibre = sequelize.define('mercadoLibre', {
    id: {
      type: DataTypes.INTEGER,
      autoIncrement: true,
      primaryKey: true
    },
    access_token: DataTypes.STRING,
    refresh_token: DataTypes.STRING,
    environment_hash: DataTypes.STRING
  }, {
    tableName: 'mercadolibres',
    underscored: true,
    timestamps: true,
    classMethods: {
      associate: function (models) {
        MercadoLibre.belongsTo(models.User)
      }
    }
  })

  return MercadoLibre
}
